<template>
  <div>
    <div style="background-color: #FFFFFF;width: 100%;height: 900px">
      <div style="margin-top: 40px;padding: 30px">
        <div style="font-size: 20px;margin-bottom: 20px">提现审核</div>
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
          <el-row>
            <el-col :span="6">
              <el-form-item label="账单编号" prop="proCode">
                <el-input v-model="queryParams.runningAccountNumber" placeholder="请输入提现订单编号" clearable @keyup.enter.native="handleQuery" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="订单编号" prop="orderNumber">
                <el-input v-model="queryParams.orderNumber" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="交易类型" prop="productName">
                <el-input v-model="queryParams.type" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="收支类型" prop="productName">
                <el-input v-model="queryParams.type" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="入账时间" prop="productName">
                <el-input v-model="queryParams.handleEndTime" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
              </el-form-item>
            </el-col>
            <el-form-item>
              <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
            </el-form-item>
          </el-row>

        </el-form>
        <el-table v-loading="loading" :data="inventoryList">
          <el-table-column label="序号" type="index" width="50" />
          <el-table-column label="账单编号" align="center" prop="runningNumber" />
          <el-table-column label="订单编号" align="center" prop="orderNumber" />
          <el-table-column label="交易类型" align="center" prop="type">
            <template slot-scope="scope">
              <el-tag>
                {{ scope.row.type==0?'收入':scope.row.type==1?"支出":"提现" }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column label="变动金额" align="center" prop="amount">

          </el-table-column>
          <el-table-column label="入账时间" align="center" prop="handleTime" />
        </el-table>
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.current" :limit.sync="queryParams.size"
                    @pagination="getList" />
      </div>
    </div>
  </div>
</template>

<script>
import { accountPage, analyseData, applyFromPage } from '@/api/property/property'

export default {
  name: 'overview',
  data(){
    return{
      queryParams: {
        current: 1,
        size: 10,
        handleEndTime: null,
        handleStartTime: null,
        orderNumber: null,
        runningAccountNumber: null,
        type: null,
      },
      total:null,
      loading:false,
      charts:{},
      inventoryList:[]
    }
  },
  created() {
    this.getList()
    // 获取统计
    this.getchart()
  },
  methods:{
    getList(){
      this.loading = true
      accountPage(this.queryParams).then(res=>{
        this.inventoryList = res.pageData
        this.loading = false
        this.total = Number(res.total)
      })
    },
    getchart(){
      analyseData().then(res =>{
        this.charts = res
      })
    },
    getfalg(e){
      e==3?this.queryParams.status=null:e==0?this.queryParams.status=0:e==1?this.queryParams.status=1:this.queryParams.status=2
      this.getList()
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      console.log(this.queryParams)
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams={
        current: 1,
        size: 10,
        handleEndTime: null,
        handleStartTime: null,
        orderNumber: null,
        runningAccountNumber: null,
        type: null,
      }
      this.handleQuery();
    },
  }
}
</script>

<style scoped>
.card-1{
  width: 220px;
  height: 80px;
  background-color: #FFFFFF;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.card-1-text{

}
.card-1-text-top{
  font-size: 20px;
  margin-bottom:10px ;
}
.botten-yes {
  width: 138px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(24, 144, 255, 0.15);
  box-sizing: border-box;
  border-width: 0px 0px 2px 0px;
  border-style: solid;
  border-color: #1890FF;
}

.botten-no {
  width: 138px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  border-width: 0px 0px 0px 0px;
  border-style: solid;
}
</style>
